//
//  ClaimPicWindow.m
//  MemberProject
//
//  Created by mac on 15/7/20.
//  Copyright (c) 2015年 MAC OS X. All rights reserved.
//

#import "ClaimPicWindow.h"
@interface ClaimPicWindow()
@property(strong,nonatomic)UIImageView *imageView;
@end
@implementation ClaimPicWindow
-(instancetype)initWithFrame:(CGRect)frame{
    if(self=[super initWithFrame:frame]){
        self.imageView=[[UIImageView alloc]initWithFrame:self.bounds];
        self.imageView.contentMode=UIViewContentModeScaleAspectFit;
        [self addSubview:self.imageView];
        
        
        self.backgroundColor = [UIColor blackColor];
        self.windowLevel = UIWindowLevelAlert;
        [self makeKeyAndVisible];
        self.hidden=YES;
        
        [self addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)]];
    }
    return self;
}

-(void)tap:(UITapGestureRecognizer *)sender{
    self.hidden=YES;
}

-(void)showWithImage:(UIImage *)image{
    self.imageView.image=image;
    self.hidden=NO;
}

-(void)hide{
    self.hidden=YES;
}
@end
